From: Florian Müllner Date: Sat, 29 Jun 2019 23:03:46 +0000 (+0200) Subject: dialog: Use Object.assign() for default property value X-Git-Tag: archive/raspbian/50.5-1+rpi1~1^2~845^2^2~38 X-Git-Url: https://dgit.raspbian.org/%22http://www.example.com/cgi/%22/%22http:/www.example.com/cgi/%22?a=commitdiff_plain;h=7d2c5c1ac9e3fb9972fb58e4b205aef5f7132d69;p=gnome-shell.git dialog: Use Object.assign() for default property value Either Params.parse() or Object.assign() are more concise for providing default values in object literals (sadly default parameters won't work here). https://gitlab.gnome.org/GNOME/gnome-shell/merge_requests/626 --- diff --git a/js/ui/dialog.js b/js/ui/dialog.js index 4989470c4..fd0069cad 100644 --- a/js/ui/dialog.js +++ b/js/ui/dialog.js @@ -180,10 +180,8 @@ var MessageDialogContent = GObject.registerClass({ this._subtitle.clutter_text.set(textProps); this._body.clutter_text.set(textProps); - if (!params.hasOwnProperty('style_class')) - params.style_class = 'message-dialog-main-layout'; - - super._init(params); + let defaultParams = { style_class: 'message-dialog-main-layout' }; + super._init(Object.assign(defaultParams, params)); this.messageBox = new St.BoxLayout({ style_class: 'message-dialog-content', x_expand: true,